#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
using namespace std;

class Solution {
public:
	bool checkInclusion(string s1, string s2) {
		string pattern = s1, text = s2;
		vector<int> charCount(26, 0);
		for (auto c : pattern)
			charCount[c - 'a']++;
		int left = 0, right = 0;
		int len1 = s1.size(), len2 = s2.size();
		while (left <= len2 - len1) {
			while (right < left + len1 && charCount[text[right] - 'a']>=1) {
				charCount[text[right] - 'a']--;
				right++;
			}
			if (right == left + len1) return true;
			charCount[text[left] - 'a']++;
			left++;
		}
		return false;
	}
};

int main() {
	string s1 = "adc";
	string s2 = "dcda";

	Solution s;
	if (s.checkInclusion(s1, s2))
		cout << "Yes" << endl;
	else cout << "No" << endl;
}